package cc.rboot.limit.grouper;

import cc.rboot.limit.core.AbstractAccessLimitGrouper;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

import java.lang.reflect.Method;

public class MethodAccessLimitGrouper extends AbstractAccessLimitGrouper {

    @Override
    public String grouper(ProceedingJoinPoint joinPoint) {
        MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
        Method targetMethod = methodSignature.getMethod();
        return joinPoint.getThis().getClass().getName() + "_" + targetMethod.getName() + "_";
    }
}
